package com.yz.test.okhttp.controller;

import com.yz.test.okhttp.model.User;
import com.yz.test.okhttp.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/doLogin")
    public User doLogin(@RequestParam(value = "username")String username,
                          @RequestParam(value = "password")String password){
        return userService.login(username, password);
    }


}
